﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MuaBanDT
{
    public partial class MainForm : Form
    {
        public Form BanHang,About,DangNhap,QuanLy,BaoHanh,NhapKho,DoiMatKhau;
        public MainForm()
        {
            InitializeComponent();
        }

        private void btnBoPhanBanH_Click(object sender, EventArgs e)
        {
            this.Hide();
            BanHang = new BanHang();
            BanHang.Show();
            BanHang.FormClosed += new FormClosedEventHandler(BanHang_FormClosed);
        }

        void BanHang_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Show();
        }

        private void aboutMobileForYouToolStripMenuItem_Click(object sender, EventArgs e)
        {
            About = new About();
            About.ShowDialog();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void bánHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            btnBoPhanBanH_Click(sender, e);
        }

        private void btnBoPhanQL_Click(object sender, EventArgs e)
        {
            DangNhap = new DangNhap();
            DangNhap.ShowDialog();
            this.đổiMậtKhẩuToolStripMenuItem.Enabled = true;
        }

        
        private void quảnLýToolStripMenuItem_Click(object sender, EventArgs e)
        {
            btnBoPhanQL_Click(sender, e);
        }

        private void đổiMậtKhẩuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DoiMatKhau = new DoiMatKhau();
            DoiMatKhau.Show();
        }

        private void btnBoPhanKT_Click(object sender, EventArgs e)
        {
            this.Hide();
            BaoHanh = new BaoHanh();
            BaoHanh.Show();
            BaoHanh.FormClosed += new FormClosedEventHandler(BaoHanh_FormClosed);
        }

        void BaoHanh_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Show();
        }

        private void kĩThuậtToolStripMenuItem_Click(object sender, EventArgs e)
        {
            btnBoPhanKT_Click(sender, e);
        }

        private void btnBoPhanNK_Click(object sender, EventArgs e)
        {
            this.Hide();
            NhapKho = new NhapKho();
            NhapKho.Show();
            NhapKho.FormClosed += new FormClosedEventHandler(NhapKho_FormClosed);
        }

        void NhapKho_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Show();
        }

        private void nhậpKhoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            NhapKho = new NhapKho();
            NhapKho.Show();
            NhapKho.FormClosed += new FormClosedEventHandler(NhapKho_FormClosed);
        }

        private void hướngDẫnSửDụngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Help.ShowHelp(this,"MuaBanDT.chm");
        }   
    }
}
